package com.yonyou.cyxdms.sysmanage.client.service.login;

import com.yonyou.cyxdms.sysmanage.client.feign.SysmanageDataCommonClient;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerInfoAVO;
import com.yonyou.cyxdms.sysmanage.client.vo.dealer.DealerOrAscOrCompanyVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DealerBasicServiceImpl implements DealerBasicService {

    @Autowired
    SysmanageDataCommonClient sysmanageDataCommonClient;

    /**
     * 获取维修站简称
     *
     * @param
     * @return java.util.List<java.util.Map   <   java.lang.String   ,   java.lang.Object>>
     * @author dengqiang
     * @since 2019/8/19
     */
    @Override
    public List<Map<String, Object>> queryDealerShortname() {
        return sysmanageDataCommonClient.queryDealerShortname().getData();
    }


    /**
     * 获取登录用户公司信息
     *
     * @param:
     * @return:
     * @auther: 李贺
     * @since: 2019/9/9
     */
    @Override
    public DealerOrAscOrCompanyVO getDealer(String ownerCode) {
        return sysmanageDataCommonClient.getDealer(ownerCode).getData();
    }

    /**
     * 通过code获取dealer
     *
     * @param:
     * @return:
     * @auther: maxingjian
     * @since: 2019/11/26
     */
    @Override
    public DealerInfoAVO getDealerByOwner(String ownerCode){
        return sysmanageDataCommonClient.getDealerByOwner(ownerCode).getData();
    }
    /**
     * 通过code获取dealer
     *
     * @param:
     * @return:
     * @auther: 获取所有dealerCode
     * @since: 2019/12/12
     */
   public List<String> getAllDealerCode( String appId) {
       return sysmanageDataCommonClient.getAllDealerCode(appId).getData();
   }
}
